/**
 * 检索input
 * @author xiaoxujs
 */

import { FC, useState } from "react";
import { SearchFZBox } from "./style";

const SearchFZ:FC<{
    placeholder?: string,
    searchChange: (value: string) => void,
}> = ({
    placeholder,
    searchChange
}) => {
    const [inputValue, setInputValue] = useState<string>(''); // 检索关键字
    return <SearchFZBox>
        <input type="search" placeholder={placeholder} value={inputValue} onChange={(e) => setInputValue(e.target.value)}/>
        <div className="input_right" onClick={() => searchChange(inputValue)}>
            <span className="iconfont">&#xe60e;</span>
        </div>
    </SearchFZBox>
}

export default SearchFZ;